<!-- 打印详情-->
<template>
  <div>
    <el-button type="primary" v-print="printObj" @click="dsss">打印</el-button>
    <el-button type="info" @click="$router.go(-1)">关闭</el-button>
    <!-- <el-card
      class="docketprintContainer"
      shadow="never"
      v-for="(item, index) in tableData"
      :key="index"
      style="page-break-after: always"
    > -->
      <div>
        <div class="TestData" style="font-size: 14px; ">
           <table border="1" cellspacing="0" id="printMe"> 
                <tr >
                    <td class="td1" style="width:15%;height:40px;">姓名</td>
                    <td class="td2">{{tableData.name}}</td>
                    <td class="td1" style="width:15%">性别</td>
                    <td class="td2">{{tableData.gender == '40' ? '男' :'女' }}</td>
                </tr>
                <tr>
                    <td class="td1">学年学期</td>
                    <td class="td2">{{tableData.academicYearTerm}}</td>
                    <td class="td1">学院</td>
                    <td class="td2">{{tableData.colleage}}</td>
                </tr>
                <tr>
                    <td class="td1">专业</td>
                    <td class="td2">{{tableData.major}}</td>
                    <td class="td1">班级</td>
                    <td class="td2">{{tableData.clbum}}</td>
                </tr>
                <tr>
                    <td class="td1">学位类型</td>
                    <td class="td2">{{tableData.degree}}</td>
                    <td class="td1">成绩</td>
                    <td class="td2">{{tableData.results}}</td>
                </tr>
            </table>
        </div>
      </div>
    <!-- </el-card> -->
  </div>
</template>

<script>
import {
  getDegreescoreItemApi
} from "@/api/degree/degreescore.js"
export default {
  data() {
    return {
      tableData: [
        {id:1, degreeType:'研究生',major:'测试新增专业',name:'田晓',sex:0,schoolYear:'2024学年',college:'财经学院',classes:'2011级',achievement:89},
      ],
      id:'',
      printObj: {
        id: "printMe", //打印区域 Dom ID
        popTitle: "成绩单详情",
        extraCss: "https://www.google.com,https://www.google.com",
        extraHead:
          '<meta http-equiv="Content-Language"content="zh-cn"/>,<style> #printMe { height: auto !important; } <style>', //  可以传进去  style tag 标签；注意要逗号分隔   解决特定区域不显示问题；
      },
    };
  },
  created() {},
  mounted() {
    this.id = this.$route.params.id
    getDegreescoreItemApi({id:this.$route.params.id}).then(res=>{
      console.log(res,'00000');
      this.tableData = res.data
      console.log(this.tableData);
    })
  },
  methods: {
    dsss() {
    },
  }
};
</script>
<style lang="scss" scoped>
table{
        width: 100%;
        margin-top: 10px;
        tr{
            .td1{
                width: 15%;
                height: 40px;
                text-align: center;
                background-color: #ccc;
                font-weight: bold;
            }
            .td2{
                width: 30%;
                padding-left: 20px;
            }
        }
    }
</style>


